package com.yitongmao.activity;

import android.content.Intent;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;

import com.yitongmao.yitmfruit.R;
import com.zhy.autolayout.AutoLinearLayout;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class AboutWeActivity extends AppCompatActivity {
    @Bind(R.id.mHistoryVersions)
    AutoLinearLayout mHistoryVersions;
    @Bind(R.id.mWithRespectToWanGuo)
    AutoLinearLayout mWithRespectToWanGuo;
    @Bind(R.id.mRedaihuitui)
    AutoLinearLayout mRedaihuitui;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        immerSion();
        setContentView(R.layout.activity_auout_we);
        ButterKnife.bind(this);
    }
    @OnClick({R.id.mHistoryVersions,R.id.mRedaihuitui, R.id.mWithRespectToWanGuo})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.mRedaihuitui:
                AboutWeActivity.this.finish();
                break;
            case R.id.mHistoryVersions:
                Intent intent = new Intent(AboutWeActivity.this, HistoryVersionActivity.class);
                startActivity(intent);
                break;
            case R.id.mWithRespectToWanGuo:
                Intent intent1 = new Intent(AboutWeActivity.this, AboutWanGuoActivity.class);
                startActivity(intent1);
                break;
        }
    }
    //沉浸式状态栏
    public void immerSion() {
        getWindow().requestFeature(Window.FEATURE_NO_TITLE);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            Window window = getWindow();
            window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS
                    | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
            window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                    | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                    | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
            window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
            window.setStatusBarColor(Color.TRANSPARENT);
            window.setNavigationBarColor(Color.BLACK);
        }
    }
}
